package test00.test04;

import test00.test01.Tiger;

/**
 * @Author lzp
 * @Date 2024-03-29
 */
public class test {
    public static void main(String[] args) {

        Dog xb = new Dog("小红");
        Cat xh = new Cat("傻春") ;

        // 实例化主人对象 - 带什么宠物？ - 通过泛型指定具体的数据类型
        People<Dog> zs = new People<>();
        zs.setPet(xb);
        People<Cat> ls = new People<>();
        ls.setPet(xh);

        zs.shopping();
        ls.shopping();

        // 错误：Tiger没有实现 WenShun 接口
        //Tiger xw = new Tiger("温济津");
        //People<Tiger> zbw = new People<>();
        //zbw.setPet(xw);
        //zbw.shopping();





    }
}
